﻿@model PhoneBilling.Models.DiscountMgtModel
@{
    ViewBag.Title = "优惠表管理";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<script type="text/javascript">
    function del(id, name) {
        var r = confirm("确认删除优惠：" + name + "吗？");
        if (r == true) {
            window.location.href = "/Manage/DiscountDelete?id=" + id;
        }
        return false;
    }
</script>
<p id="btn-create" class="box"><a href="/Manage/DiscountEdit"><span>新增优惠</span></a></p>
@{
    var grid = new WebGrid(source: Model.DiscountList, rowsPerPage: 30);
}
@grid.GetHtml(
    alternatingRowStyle: "bg",
    columns:grid.Columns
    (
        grid.Column("优惠名称","优惠名称"),
        grid.Column("起始时间","起始时间"),
        grid.Column("终止时间","终止时间"),
        grid.Column("折扣话类","折扣话类"),
        grid.Column("基本费折扣","基本费折扣"),
        grid.Column("附加费折扣","附加费折扣"),
        grid.Column("服务费折扣","服务费折扣"),
        grid.Column(format:(item)=> Html.ActionLink("修改","DiscountEdit",new {id=item.ItemNo})),
        grid.Column(format: (item) => Html.Raw(string.Format("<a href='javascript:' onclick=\"del('{0}','{1}')\">删除</a>", item.ItemNo, item.优惠名称)))
    )
)
